


//
//  SZZtatusModel.swift
//  SZZweibo
//
//  Created by 申壮壮 on 16/8/17.
//  Copyright © 2016年 itcast. All rights reserved.
//

import UIKit

class SZZtatusModel: NSObject {
    //时间
    var  created_at: String?
    //微博ID
    var  id: Int = 0
    //内容
    var  text: String?
    //来源
    var source: String?
    //用户模型
    var user:SZZUserModel?
    
    init(dict: [String: AnyObject]) {
        
        super.init()
        
        setValuesForKeysWithDictionary(dict)
        
    }
    
    //重写SetValues
    override func setValue(value: AnyObject?, forKey key: String) {
        if key == "user"{
            
            guard let v = value as?[String: AnyObject] else{
                
                return
             
            }
            user = SZZUserModel(dict: v)
            
        }else{
            
            super.setValue(value, forKey: key)
        }
    }
        override func setValue(value: AnyObject?, forUndefinedKey key: String) {
            
        }
  

}
